import { setWatcher } from "./watch";

Page({
    data: {
        val: "",
        obj: {},
    },

    onLoad() {
        setWatcher(this);
        this.setData({
            obj: { name: "Tom" },
        });
    },

    watch: {
        val(v) {
            console.log(v);
        },
        obj: {
            handler(v) {
                console.log("监听属性值的变化");

                console.log(v);
            },
            deep: true,
        },
    },
});